package cn.com.twoke.application.game.mario.game.util;

import cn.com.twoke.application.game.mario.core.ecs.entity.Entity;
import cn.com.twoke.application.game.mario.game.component.PlayerComponent;

import java.util.List;

/**
 * 玩家工具类
 */
public abstract class PlayerUtils {


    public static Entity getPlayer(List<Entity> entities) {
        return entities.stream().filter(item -> item.hasComponent(PlayerComponent.class)).findFirst().orElse(null);
    }

}
